const url = require("url");
const fs = require("fs");

module.exports = function(req, res){
	//res.setHeader("Access-Control-Allow-Origin","*");
	
	//解析请求的路径地址
	let urlinfo = url.parse(req.url, true);

	//根据不同的地址，调用不同的程序处理
	for(let path in URLMapping) {
		if( new RegExp(path).test(urlinfo.pathname) )  {
			URLMapping[path](urlinfo, res);
			break;
		}
	}
}

const URLMapping = {
	"\/secondnav$": require("./interface/seclist.js")
}

